﻿
namespace ZeroBugBounce.Missive
{
	public enum DispatchMode : int
	{
		/// <summary>
		/// Run asynchronously.  
		/// 
		/// In the TaskParallelDispatcher, this means run as a normal 
		/// Task and Wait completion using Task.Wait() in the 
		/// ThreadPool
		/// </summary>
		Asynchronous = 0,
		/// <summary>
		/// Run asynchronously and expect long run times.
		/// 
		/// n the TaskParallelDispatcher, this means run as a Task
		/// with TaskCreationOptions.LongRunning which will run it
		/// in its own thread and not in the ThreadPool
		/// </summary>
		AsyncLongRunning = 1,
		/// <summary>
		/// Run asynchronously as with Async, but avoid kernel mode
		/// locking as the task will complete very quickly.
		/// 
		/// In the TaskParallelDispatcher, a counter is incremented 
		/// for each handler started with this setting and is
		/// decremented when completed
		/// </summary>
		Synchronous = 3
	}
}
